package com.ruoyi.consume.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.consume.mapper.PlugApplyTemporaryConMapper;
import com.ruoyi.consume.domain.PlugApplyTemporaryCon;
import com.ruoyi.consume.service.IPlugApplyTemporaryConService;

/**
 * 穴盘临时领用Service业务层处理
 *
 * @author ruoyi
 * @date 2021-07-27
 */
@Service
public class PlugApplyTemporaryConServiceImpl implements IPlugApplyTemporaryConService
{
    @Autowired
    private PlugApplyTemporaryConMapper plugApplyTemporaryConMapper;

    /**
     * 查询穴盘临时领用
     *
     * @param plugApplyTemporaryId 穴盘临时领用ID
     * @return 穴盘临时领用
     */
    @Override
    public PlugApplyTemporaryCon selectPlugApplyTemporaryById(Long plugApplyTemporaryId)
    {
        return plugApplyTemporaryConMapper.selectPlugApplyTemporaryById(plugApplyTemporaryId);
    }

    /**
     * 查询穴盘临时领用列表
     *
     * @param plugApplyTemporaryCon 穴盘临时领用
     * @return 穴盘临时领用
     */
    @Override
    public List<PlugApplyTemporaryCon> selectPlugApplyTemporaryList(PlugApplyTemporaryCon plugApplyTemporaryCon)
    {
        return plugApplyTemporaryConMapper.selectPlugApplyTemporaryList(plugApplyTemporaryCon);
    }

    /**
     * 新增穴盘临时领用
     *
     * @param plugApplyTemporaryCon 穴盘临时领用
     * @return 结果
     */
    @Override
    public int insertPlugApplyTemporary(PlugApplyTemporaryCon plugApplyTemporaryCon)
    {
        plugApplyTemporaryCon.setCreateTime(DateUtils.getNowDate());
        return plugApplyTemporaryConMapper.insertPlugApplyTemporary(plugApplyTemporaryCon);
    }

    /**
     * 修改穴盘临时领用
     *
     * @param plugApplyTemporaryCon 穴盘临时领用
     * @return 结果
     */
    @Override
    public int updatePlugApplyTemporary(PlugApplyTemporaryCon plugApplyTemporaryCon)
    {
        plugApplyTemporaryCon.setUpdateTime(DateUtils.getNowDate());
        return plugApplyTemporaryConMapper.updatePlugApplyTemporary(plugApplyTemporaryCon);
    }

    /**
     * 批量删除穴盘临时领用
     *
     * @param plugApplyTemporaryIds 需要删除的穴盘临时领用ID
     * @return 结果
     */
    @Override
    public int deletePlugApplyTemporaryByIds(Long[] plugApplyTemporaryIds)
    {
        return plugApplyTemporaryConMapper.deletePlugApplyTemporaryByIds(plugApplyTemporaryIds);
    }

    /**
     * 删除穴盘临时领用信息
     *
     * @param plugApplyTemporaryId 穴盘临时领用ID
     * @return 结果
     */
    @Override
    public int deletePlugApplyTemporaryById(Long plugApplyTemporaryId)
    {
        return plugApplyTemporaryConMapper.deletePlugApplyTemporaryById(plugApplyTemporaryId);
    }

    /**
     * 更新库存量表
     *
     * @param plugApplyTemporaryCon 穴盘临时领用
     * @return 结果
     */
    @Override
    public int updateAmount(PlugApplyTemporaryCon plugApplyTemporaryCon){
        return plugApplyTemporaryConMapper.updateAmount(plugApplyTemporaryCon);
    }

    /**
     * 更新领用状态
     *
     * @param plugApplyTemporaryId 穴盘临时领用ID
     * @return 结果
     */
    @Override
    public int updateConsumeStatus(Long plugApplyTemporaryId){
        return plugApplyTemporaryConMapper.updateConsumeStatus(plugApplyTemporaryId);
    }

    /**
     * 退回操作
     *
     * @param plugApplyTemporaryId 穴盘临时领用ID
     * @return 结果
     */
    @Override
    public int updateApprovalStatus(Long plugApplyTemporaryId){
        return plugApplyTemporaryConMapper.updateApprovalStatus(plugApplyTemporaryId);
    }
}
